package cn.dust.design.principle.openclose;

/**
 * @Author: dust
 * @Date: 2019/11/24 18:25
 */
public class JavaDiscountCource extends JavaCource{

    public JavaDiscountCource(Integer id, String name, double price) {
        super(id,name,price);
    }

    public Double getOrigenPrice(){
        return super.getPrice();
    }

    @Override
    public Double getPrice() {
        if(super.getPrice()>200){
            return super.getPrice()*0.5;
        }else if(super.getPrice()>100&&super.getPrice()<=200){
            return super.getPrice()*0.8;
        }else{
            return super.getPrice();
        }

    }
}
